package com.wms.controller;

import com.wms.bean.ResultBean;
import com.wms.core.R;
import com.wms.service.QuickArrivalListService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@Api(tags = "快捷到货登记单")
@RequestMapping("/fastArrival")
public class QuickArrivalListController {

    @Autowired
    QuickArrivalListService quickArrivalListService;

    @ApiOperation(value = "获取快捷到货登记单")
    @GetMapping("/info")
    public ResultBean getAll(){
        List list= quickArrivalListService.getAll();
        return R.success("查询成功",list);
    }

    @ApiOperation(value = "根据id删除到货登记单")
    @DeleteMapping("/deleteById")
    public ResultBean removeById(@RequestParam int id){
        int n= quickArrivalListService.removeById(id);
        return n==1?R.success("删除成功"):R.fail("删除失败");
    }
}
